<template>
	<view>
		<!--service/account/account.wxml-->
		<view class="account z-padding-32" v-if="token">
			<view class="way z-padding-32 z-margin-b-32 z-flex-c-s-b" @tap.stop="tobindAccount(0)">
				<view class="way-flex">
					<image src="../../static/service/Alipay.png" class="bank-img"></image>
					<view class="z-margin-l-24">
						<view class="way-title">提现至支付宝</view>
						<view class="way-text z-margin-t-16" v-if="info.alipay_name && info.alipay_account">
							{{ info.alipay_name }} {{ info.alipay_account }}
							<image class="next-r" src="../../static/service/r-img.png"></image>
						</view>
						<view class="way-text z-margin-t-16" v-else>
							请设置提现账户
							<image class="next-r" src="../../static/service/r-img.png"></image>
						</view>
					</view>
				</view>
			</view>

			<view class="way z-padding-32 z-flex-c-s-b" @tap.stop="tobindAccount(1)">
				<view class="way-flex">
					<image src="../../static/service/bank-card.png" class="bank-img"></image>
					<view class="z-margin-l-24">
						<view class="way-title">提现至银行卡</view>
						<view class="way-text z-margin-t-16" v-if="info.bank_user && info.bank_name && info.bank_card">
							{{ info.bank_user }} {{ info.bank_card }}
							<image class="next-r" src="../../static/service/r-img.png"></image>
						</view>
						<view class="way-text z-margin-t-16" v-else>
							请设置提现账户
							<image class="next-r" src="../../static/service/r-img.png"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			info: '',
			token: uni.getStorageSync('token')
		};
	},
	onShow() {
		this.getInfo();
	},
	methods: {
		tobindAccount(e) {
			uni.navigateTo({
				url: '/service/bindAccount/bindAccount?account=' + e
			});
		},
		getInfo() {
			this.http.get('index/updateuser').then((res) => {
				this.info = res.data
			});
		}
	}
};
</script>

<style>
.account {
	height: 100vh;
	background-color: #edf1f4;
	box-sizing: border-box;
}

.way {
	width: 622rpx;
	height: 88rpx;
	background: #ffffff;
	border-radius: 20rpx 20rpx 20rpx 20rpx;
	opacity: 1;
	margin: auto;
}

.check-img {
	width: 32rpx;
	height: 32rpx;
}

.bank-img {
	width: 40rpx;
	height: 40rpx;
}

.way-flex {
	display: flex;
	align-items: center;
}

.way-title {
	font-size: 30rpx;
	font-weight: 500;
	color: #1c274c;
}

.way-text {
	font-size: 22rpx;
	font-weight: 500;
	color: #a4a9b7;
}

.next-r {
	width: 22rpx;
	height: 22rpx;
	vertical-align: middle;
}
</style>
